package com.zbec.mdrs.license.security;

import org.springframework.security.authentication.encoding.Md5PasswordEncoder;

public class MD5Utils {
    public static String encodePassword(String pass) {
        Md5PasswordEncoder md5 = new Md5PasswordEncoder();
        md5.setEncodeHashAsBase64(false);
        return md5.encodePassword(pass, null);
    }

    public static void main(String[] args) {
        Md5PasswordEncoder md5 = new Md5PasswordEncoder();
        md5.setEncodeHashAsBase64(false);
        String pwd = md5.encodePassword("M", null);
        System.out.println("MD5: " + pwd + " len=" + pwd.length());
    }
}
